home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1994 / MacHack 1994.toast / MacHack™ 1987-1994 / MacHack™ '93 / Hacks '93 / Johan / init.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-17  |  984 b   |  59 lines  |  [TEXT/KAHL]

  1. #include "hm.h"
  2.  
  3. void            initMac(void);
  4. void            initMenus(void);
  5. void            initWindows(void);
  6.  
  7.  
  8.  
  9. void initMac(void)
  10. {
  11.     InitGraf(&thePort);
  12.     InitFonts();
  13.     InitWindows();
  14.     InitMenus();
  15.     TEInit();
  16.     InitDialogs(NULL);
  17.     InitCursor();
  18. }
  19.  
  20.  
  21. void initMenus(void)
  22. {
  23.     menuApple = GetMenu(MENU_Apple);
  24.     AddResMenu(menuApple, 'DRVR');
  25.     InsertMenu(menuApple, 0);
  26.     
  27.     menuFile = GetMenu(MENU_File);
  28.     InsertMenu(menuFile, 0);
  29.     
  30.     DrawMenuBar();
  31. }
  32.  
  33.  
  34. void initWindows(void)
  35. {
  36.     mazeWindow = GetNewCWindow(WIND_Maze, 0, (WindowPtr)-1);
  37.     ShowWindow(mazeWindow);
  38.     
  39.     dragBounds = qd.screenBits.bounds;
  40.     InsetRect(&dragBounds, 5, 5);
  41.     dragBounds.top   += GetMBarHeight();
  42.     sizeBounds.top    = 2 * (ICON_SIZE + ICON_MARGIN * 2) + SMALLEST_SIZE;
  43.     sizeBounds.left   = sizeBounds.top;
  44.     sizeBounds.right  = width(dragBounds);
  45.     sizeBounds.bottom = height(dragBounds) - 20;
  46. }
  47.  
  48.  
  49. void init(void)
  50. {
  51.     initMac();
  52.     initMenus();
  53.     initWindows();
  54.     
  55.     scratchRgn = NewRgn();
  56.     scrollRgn = NewRgn();
  57.     location.h = 0;
  58.     location.v = 0;
  59. }